package parser.nodes;

import java.util.ArrayList;
import java.util.List;
import scanner.Token;

// IdentList = ident {',' ident}
public class IdentListNode extends Node {
    private List<Token> identList = new ArrayList<>();
    
    public IdentListNode(Token ident) {
        identList.add(ident);
    }
    
    public void addIdent(Token ident) {
        identList.add(ident);
    }

    public List<Token> getIdentList() {
            return identList;
    }
	
    @Override
    public void print() {
        p("IdentList:");
        indent();
        for(Token ident : identList) {
            p(ident);
            p(",");
        }
        unindent();
    }

    @Override
    public void abstractPrint() {
        p("IDENTLIST");
        indent();
        for(Token ident : identList)
            p(ident);
        unindent();
    }
    
    
}
